package com.ruoyi.depot.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.OrdersProduct;
import com.ruoyi.depot.domain.vo.OrdersProductVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 货币单位Mapper接口
 * 
 * @author ruoyi
 * @date 2023-11-02
 */
@Mapper
public interface OrdersProductMapper extends BaseMapper<OrdersProduct>
{
	/**
	 * 查询库存待检量详细
	 */
	List<OrdersProductVO> openInspectionQuantityDialog(@Param("vo") OrdersProductVO vo);


	/**
	 * 根据销售计划编号和sku查询采购成本
	 * @param planNumber
	 * @param sku
	 * @return
	 */
	List<BigDecimal> selectBySaleNumberAndSku(@Param("planNumber") String planNumber,@Param("sku") String sku);

	/**
	 * 更新对应采购订单商品明细的待退货数量
	 * @param productId
	 * @param procuredOrderNumber
	 * @return
	 */
	int updateByOrdersIdAndReturnPendingQuantity(@Param("productId") Long productId,
												 @Param("procuredOrderNumber") String procuredOrderNumber,
												 @Param("count") Integer count);

	/**
	 * 查询采购订单商品详细
	 * @param productId
	 * @param procuredOrderNumber
	 * @return
	 */
	OrdersProduct selectOnes(@Param("productId") Long productId,@Param("procuredOrderNumber") String procuredOrderNumber);
}
